<?php

App::uses('AppController', 'Controller');

class CaptchasController extends AppController {

    var $name = 'Captchas';
    var $helpers = array('Session', 'Js', 'Form', 'Cache', 'Time');
    var $components = array("Captcha", 'Session' );


    /**
     * Show captcha image
     *
     * @param string  - name in session
     * @access public
     */
    function index() {
		// old
        $name =  trim((string)$_GET['name']);

        if (!empty($name)) {
            $this->Captcha->render($name);
        }
        exit;
    }

	function test(){
//		$a = $_SESSION['send-contact'];
//		pr($a.'Dung $_Session');
		if(!$this->Session->check('send-contact')) {
			pr('Khong ton tai ');
		} else {
			$captcha = $this->Session->read('send-contact');
			pr('--------- '.$captcha.' ---------------');
		}
		
		exit;
	}
}